<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>班级列表</title>
    <link href="/css/bootstrap.css" rel="stylesheet" type="text/css">
    <script src="/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
    <h1 class="text-center">班级列表</h1>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>序号</th>
                <th>班级名称</th>
                <th>学院</th>
                <th>教师</th>
                <th>班级人数</th>
                <th>已点名次数</th>
                <th>累计缺勤人数</th>
                <th>累计缺勤率</th>
            </tr>
        </thead>
        <tbody></tbody>
    </table>

    <script>
        $(function() {
           $.get(
              "/class/list",
              function(data) {
                  for (var i in data) {

                      var tr = $("<tr></tr>");
                      tr.append("<td>" +data[i].id+ "</td>");
                      tr.append("<td>" +data[i].className+ "</td>");
                      tr.append("<td>" +data[i].college+ "</td>");
                      tr.append("<td>" +data[i].teacherName+ "</td>");
                      tr.append("<td>" +data[i].studentNum+ "</td>");
                      tr.append("<td>" +data[i].checkNum+ "</td>");
                      tr.append("<td>" +data[i].absencePersonNum+ "</td>");
                      tr.append("<td>" +data[i].absenceRate+ "</td>");
                      $("tbody").append(tr);
                  }
              }
           );
        });
    </script>
</body>
</html>
